package com.sfcms.provider.dao;

import com.sfcms.provider.model.News;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface NewsDao extends JpaRepository<News, Integer> {
    News findNewsById(Integer id);

    @Query(name = "findNewsByTitle", nativeQuery = true, value = "select * from tb_news where title=:title ")
    List<News> findNewsByTitle(@Param("title") String title);
}
